# $Id: PKGBUILD 78850 2012-10-25 21:34:58Z ebelanger $
# Maintainer: Sven-Hendrik Haase <sh@lutzhaase.com>

pkgname=vdrift-data
_pkgname=vdrift
pkgver=2012.07.22
pkgrel=1
epoch=2
pkgdesc="An open source driving simulation made with drift racing in mind (data files)"
arch=('any')
url="http://vdrift.net/"
license=('GPL')
depends=('bullet' 'curl' 'sdl_gfx' 'sdl_image' 'glew' 'libvorbis')
makedepends=('scons' 'boost' 'asio' 'mesa')
source=(http://downloads.sourceforge.net/sourceforge/$_pkgname/$_pkgname-${pkgver//./-}.tar.bz2
        vdrift-2012-07-22c_bullet281_patch.diff)
md5sums=('fcfd6b65724d32dfe383df216d7afb74'
         '67ff3037575c3aa74393971d1475ef54')

build() {
  cd "$srcdir"/VDrift

  # select arch
  if [ `uname -m` = "x86_64" ]; then
    _sconsarch="a64"
  else
    _sconsarch="686"
  fi

  patch -Np0 < "$srcdir"/vdrift-2012-07-22c_bullet281_patch.diff

  # build and install
  scons $MAKEFLAGS \
    "destdir"="$pkgdir" \
    "arch"=$_sconsarch \
    "release"=1 \
    "force_feedback"=1 \
    "prefix"=/usr \
    "datadir"=share/$_pkgname/ \
    "extbullet"=1
}

package() {
  cd "$srcdir"/VDrift

  scons install

  rm -r "$pkgdir/usr/bin"
}
# vim: sw=2:ts=2 et:
